/*
 *  utils.h
 *  bgsubtraction
 *
 *  Created by a1gucis on 3/17/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */
#ifndef UTILS_H
#define UTILS_H
#include <iostream>
#include <math.h>
#include "systeminclude.h"

using namespace std;
class Utils{
private:
	static float min(float r, float g, float b); //returns the minimum value between r, g, b parameters
	static float max(float r, float g, float b); //returns the maximum value between r, g, b parameters
public:
	static void ToMatrix(IplImage *, CvMat *); //convert 1 channel or 3 channels image to matrix
	static void ToDMatrix(IplImage *, CvMat *); //same as ToMatrix, just image has double values
	static void ToMatrix(IplImage *, CvMat *, int);
	static void ToMatrix(IplImage *, CvMat *, int, int);
	static void ToNormalImg(IplImage *, int); //convert 1 channel image of clusters to viewable image
	static float MatrixSum(CvMat *); //calculates the sum of the matrix
	static void PrintMat(const CvMat *); //print the contents of the matrix
	static void PrintDImg(IplImage *); //prints the contents of iplimage, holding double values
	static void FillImg(IplImage *, int color); //image filled with particular color
	static void AppendImg(IplImage *src, IplImage *dst, int imgNumber); //appends src image to dst image at position imgNumber
	static void ToWeightedImg(IplImage *src, IplImage *dst); //recalculates image to weighted image
	static void ToWeightedImg32F(IplImage *src, IplImage *dst);
	static void ToHSIImg(IplImage *src, IplImage *dst);
	static void CheckForNans(IplImage *image);
};


#endif
